module DefinitionsHelper
  def add_constant_link(name)
    link_to_function name do |page|
      page.insert_html :bottom, :definition_parts,
      :partial => 'constant', :object => Constant.new
    end
  end
  
  def add_sequence_link(name)
    link_to_function name do |page|
      page.insert_html :bottom, :definition_parts,
        :partial => 'sequence', :object => Sequence.new 
    end
  end
  
  def enable_sorting
    sortable_element 'definition_parts', 
    :complete => visual_effect(:highlight, 'definition_parts'), 
    :url => { :action => "order" }
  end
end